# serializers.py

from rest_framework import serializers
from .models import ReciteSession, ReciteRecord

class ReciteSessionSerializer(serializers.ModelSerializer):
    class Meta:
        model = ReciteSession
        fields = '__all__'
        read_only_fields = ['user', 'start_time', 'end_time']

class ReciteRecordSerializer(serializers.ModelSerializer):
    class Meta:
        model = ReciteRecord
        fields = '__all__'
        read_only_fields = ['user', 'session', 'last_study_time']
